# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidPublisher.V3.Model.TrackRelease do
  @moduledoc """
  A release within a track.

  ## Attributes

  *   `countryTargeting` (*type:* `GoogleApi.AndroidPublisher.V3.Model.CountryTargeting.t`, *default:* `nil`) - Restricts a release to a specific set of countries.
  *   `inAppUpdatePriority` (*type:* `integer()`, *default:* `nil`) - In-app update priority of the release. All newly added APKs in the release will be considered at this priority. Can take values in the range [0, 5], with 5 the highest priority. Defaults to 0. in_app_update_priority can not be updated once the release is rolled out. See https://developer.android.com/guide/playcore/in-app-updates.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The release name. Not required to be unique. If not set, the name is generated from the APK's version_name. If the release contains multiple APKs, the name is generated from the date.
  *   `releaseNotes` (*type:* `list(GoogleApi.AndroidPublisher.V3.Model.LocalizedText.t)`, *default:* `nil`) - A description of what is new in this release.
  *   `status` (*type:* `String.t`, *default:* `nil`) - The status of the release.
  *   `userFraction` (*type:* `float()`, *default:* `nil`) - Fraction of users who are eligible for a staged release. 0 < fraction < 1. Can only be set when status is "inProgress" or "halted".
  *   `versionCodes` (*type:* `list(String.t)`, *default:* `nil`) - Version codes of all APKs in the release. Must include version codes to retain from previous releases.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :countryTargeting => GoogleApi.AndroidPublisher.V3.Model.CountryTargeting.t() | nil,
          :inAppUpdatePriority => integer() | nil,
          :name => String.t() | nil,
          :releaseNotes => list(GoogleApi.AndroidPublisher.V3.Model.LocalizedText.t()) | nil,
          :status => String.t() | nil,
          :userFraction => float() | nil,
          :versionCodes => list(String.t()) | nil
        }

  field(:countryTargeting, as: GoogleApi.AndroidPublisher.V3.Model.CountryTargeting)
  field(:inAppUpdatePriority)
  field(:name)
  field(:releaseNotes, as: GoogleApi.AndroidPublisher.V3.Model.LocalizedText, type: :list)
  field(:status)
  field(:userFraction)
  field(:versionCodes, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidPublisher.V3.Model.TrackRelease do
  def decode(value, options) do
    GoogleApi.AndroidPublisher.V3.Model.TrackRelease.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidPublisher.V3.Model.TrackRelease do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
